﻿using Domain.Entities.AuditTrails;
using FluentMigrator;
using FrameworkCore.Extensions;

namespace Domain.Migrations.AuditTrails;

//[Migration(202412252221)]
//public class AuditTrailAddAndDeleteColumn : ForwardOnlyMigration
//{
//    public override void Up()
//    {
//        Alter.Table(MigrationExpressions.GetTableName(typeof(AuditTrail)))
//          .AddColumn(MigrationExpressions.ColumnNameFor<AuditTrail>(nameof(AuditTrail.AffectedColumnsJson))).AsString(int.MaxValue).Nullable().WithColumnDescription("修改后的行")
//          .AddColumn(MigrationExpressions.ColumnNameFor<AuditTrail>(nameof(AuditTrail.OldValuesJson))).AsString(int.MaxValue).Nullable().WithColumnDescription("旧值")
//          .AddColumn(MigrationExpressions.ColumnNameFor<AuditTrail>(nameof(AuditTrail.NewValuesJson))).AsString(int.MaxValue).Nullable().WithColumnDescription("新值")
//          .AddColumn(MigrationExpressions.ColumnNameFor<AuditTrail>(nameof(AuditTrail.PrimaryKeyJson))).AsString(int.MaxValue).Nullable().WithColumnDescription("主键");

//        Delete.Column(nameof(AuditTrail.AffectedColumns)).FromTable(MigrationExpressions.GetTableName(typeof(AuditTrail)));
//        Delete.Column(nameof(AuditTrail.OldValues)).FromTable(MigrationExpressions.GetTableName(typeof(AuditTrail)));
//        Delete.Column(nameof(AuditTrail.NewValues)).FromTable(MigrationExpressions.GetTableName(typeof(AuditTrail)));
//        Delete.Column(nameof(AuditTrail.PrimaryKey)).FromTable(MigrationExpressions.GetTableName(typeof(AuditTrail)));
//    }
//}
